<div class="layui-form" lay-filter="layuiadmin-form-userform" style="padding: 20px 30px 0 0;margin: 0 auto;">



    <div class="layui-form-item">
        <label class="layui-form-label">车辆编号</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="agvId" value="{{ d.params.agvId || '' }}" lay-verify="" readonly="readonly" placeholder="请输入车辆编号" autocomplete="off" class="layui-input">
                <!-- <select name="agvId" id="sosoa" style="background-color: #F5F5F5;">
                </select> -->
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">故障码</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="code" value="{{ d.params.code || '' }}" lay-verify="" placeholder="请输入预警或故障码" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">故障描述</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="remark" value="{{ d.params.remark || '' }}" lay-verify="" placeholder="请输入故障描述" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">报警时间</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="time" id="date" value="{{ d.params.time || '' }}" lay-verify="" placeholder="请输入报警时间" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">处理时间</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="optTime" id='optTime' value="{{ d.params.optTime || '' }}" lay-verify="" placeholder="请输入处理时间" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">处理人员</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="operator" value="{{ d.params.operator || '' }}" lay-verify="" placeholder="请输入处理人员" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <script type="text/html" template>
                <input type="radio" name="status" checked value="0" title="待处理" {{ d.params.status===0 ? 'checked' : '' }}>
                <input type="radio" name="status" value="1" title="处理中" {{ d.params.status===1 ? 'checked' : '' }}>
                <input type="radio" name="status" value="2" title="已处理" {{ d.params.status===2 ? 'checked' : '' }}>
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="LAY-user-back-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>

<style type="text/css">
    .layui-form-label {
        width: 95px;
    }
</style>
<script>
    layui.use(['useradmin'], layui.factory('useradmin')).use(['admin', 'useradmin'], function() {
        var $ = layui.$,
            admin = layui.admin,
            setter = layui.setter,
            form = layui.form;

        admin.req({
            url: setter.request.baseUrl + "agv-info/query",
            data: JSON.stringify({
                pageNum: 1,
                pageSize: 100
            }),
            type: "POST",
            dataType: "json",
            contentType: "application/json;charset=UTF-8",
            done: function(res) {
                console.log(res);
                var html = "<option style='color:#e6e6e6;'></option>";
                for (i = 0; i < res.info.length; i++) {
                    if (res.info[i].agvId == null) {

                    } else {
                        html += "<option name='agvId'  value=" + res.info[i].agvId + ">" + res.info[i].agvId + "</option>"
                    }

                }

                $("#sosoa").empty().append(html)
                    // var gongsiname = $("#soso1").val();
                    // console.log('11111', $("#soso1").val())
                    // if (gongsiname != "") {
                    //     $("#sosoa option[value=" + gongsiname + "]").attr("selected", true);
                    // }
                form.render('select'); //需要渲染一下
            },

        });
    })
</script>